package com.citms.remote.util;

import com.citms.exception.CloudException;
import com.citms.remote.model.ResultInfoModel;

public class CloudUtils {

    public static <T> T getResult(ResultInfoModel<T> infoModel){
        if(infoModel != null && infoModel.getCode() == 0){
            return infoModel.getResult();
        } else{
            throw new CloudException(BeanTool.objectToJsonStr(infoModel));
        }
    }
}
